#include "NetworkListener.h"

void NetworkListener::update(GameMessage e){
        if (e.m_type == GameMessage::NEW_MSG)
        {
                std::string chaine = e.m_login + ">: ";
                chaine += e.m_message;
                std::cout << chaine << std::endl;
        }
        else if(e.m_type == GameMessage::PERSON_CONNECTED)
        {
                player_joined(e.m_login,e.m_list_string);

        }
        else if(e.m_type == GameMessage::PERSON_LEFT)
        {
                player_left(e.m_login,e.m_list_string);

        }else if(e.m_type == GameMessage::POSITION_CHANGED)
		{
          update_position(e.m_login);
        }
}
